const webpack = require("webpack");
const path = require("path");
module.exports = {
  devServer: {
    port: 8666, //  端口号的配置
    open: true // 自动打开浏览器
  },
  css: {
    sourceMap: true, // 开启 CSS source maps
  },
  publicPath: "./",
  lintOnSave: false, //配置关闭eslint
  configureWebpack: {
    plugins: [
      new webpack.ProvidePlugin({
        $: "jquery",
        jQuery: "jquery",
        "windows.jQuery": "jquery",
      }),
    ],
    //关闭 webpack 的性能提示
    performance: {
      hints: false,
    },
    //警告 webpack 的性能提示
    performance: {
      hints: "warning",
      //入口起点的最大体积
      maxEntrypointSize: 50000000,
      //生成文件的最大体积
      maxAssetSize: 30000000,
      //只给出 js 文件的性能提示
      assetFilter: function (assetFilename) {
        return assetFilename.endsWith(".js");
      },
    },
  }
}
